Optimal. Leaf size=69 \[ \frac{(a B+A b) \sin (c+d x)}{d}+\frac{1}{2} x (a (A+2 C)+2 b B)+\frac{a A \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b C \tanh ^{-1}(\sin (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15622, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.128, Rules used = {4074, 4047, 8, 4045, 3770} \[ \frac{(a B+A b) \sin (c+d x)}{d}+\frac{1}{2} x (a (A+2 C)+2 b B)+\frac{a A \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b C \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4074
Rule 4047
Rule 8
Rule 4045
Rule 3770
Rubi steps
\begin{align*} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac{a A \cos (c+d x) \sin (c+d x)}{2 d}-\frac{1}{2} \int \cos (c+d x) \left (-2 (A b+a B)-(2 b B+a (A+2 C)) \sec (c+d x)-2 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac{a A \cos (c+d x) \sin (c+d x)}{2 d}-\frac{1}{2} \int \cos (c+d x) \left (-2 (A b+a B)-2 b C \sec ^2(c+d x)\right ) \, dx-\frac{1}{2} (-2 b B-a (A+2 C)) \int 1 \, dx\\ &=\frac{1}{2} (2 b B+a (A+2 C)) x+\frac{(A b+a B) \sin (c+d x)}{d}+\frac{a A \cos (c+d x) \sin (c+d x)}{2 d}+(b C) \int \sec (c+d x) \, dx\\ &=\frac{1}{2} (2 b B+a (A+2 C)) x+\frac{b C \tanh ^{-1}(\sin (c+d x))}{d}+\frac{(A b+a B) \sin (c+d x)}{d}+\frac{a A \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.122287, size = 68, normalized size = 0.99 \[ \frac{4 (a B+A b) \sin (c+d x)+a A \sin (2 (c+d x))+2 a A c+2 a A d x+4 a C d x+4 b B d x+4 b C \tanh ^{-1}(\sin (c+d x))}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.064, size = 100, normalized size = 1.5 \begin{align*}{\frac{Aa\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{aAx}{2}}+{\frac{Aac}{2\,d}}+{\frac{Ba\sin \left ( dx+c \right ) }{d}}+aCx+{\frac{Cac}{d}}+{\frac{Ab\sin \left ( dx+c \right ) }{d}}+Bbx+{\frac{Bbc}{d}}+{\frac{Cb\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.03043, size = 120, normalized size = 1.74 \begin{align*} \frac{{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a + 4 \,{\left (d x + c\right )} C a + 4 \,{\left (d x + c\right )} B b + 2 \, C b{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a \sin \left (d x + c\right ) + 4 \, A b \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.541492, size = 192, normalized size = 2.78 \begin{align*} \frac{{\left ({\left (A + 2 \, C\right )} a + 2 \, B b\right )} d x + C b \log \left (\sin \left (d x + c\right ) + 1\right ) - C b \log \left (-\sin \left (d x + c\right ) + 1\right ) +{\left (A a \cos \left (d x + c\right ) + 2 \, B a + 2 \, A b\right )} \sin \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.19254, size = 215, normalized size = 3.12 \begin{align*} \frac{2 \, C b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, C b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) +{\left (A a + 2 \, C a + 2 \, B b\right )}{\left (d x + c\right )} - \frac{2 \,{\left (A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, A b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, A b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]